package com.jule.miaozhuapc.dto;

import org.apache.poi.ss.formula.functions.T;

import lombok.Data;

@Data 
public class WsUtil {

	private Status status;

	public WsUtil(String code, String message) {
		Status status  = new Status();
		status.setCode(code);
		status.setMessage(message);
		this.status = status;
	}
	public WsUtil() {
		Status status  = new Status();
		status.setCode("000000000");
		status.setMessage("成功");
		this.status = status;
	}

	public WsUtil(Boolean rst) {
		Status status  = new Status();
		if (rst) {
			status.setCode("000000000");
			status.setMessage("成功");
			this.status = status;
		}else {
			status.setCode("000000001");
			status.setMessage("失败");
			this.status = status;
		}
	}
	
	public WsUtil(Boolean rst, String msg) {
		Status status  = new Status();
		if (rst) {
			status.setCode("000000000");
			status.setMessage("成功");
			this.status = status;
		}else {
			status.setCode(msg);
			status.setMessage("失败");
			this.status = status;
		}
	}
	
	public Object body;

	public Status getStatus() {
		return status;
	}
	public void setStatus(Status status) {
		this.status = status;
	}
	public Object getBody() {
		return body;
	}
	public  void setBody(Object body) {
		this.body = body;
	}
	
	
	@Data 
	class Status{
		public String getCode() {
			return code;
		}
		public void setCode(String code) {
			this.code = code;
		}
		public String getMessage() {
			return message;
		}
		public void setMessage(String message) {
			this.message = message;
		}
		public String code;
		public String message;
	}
}

